const mongoose=require('./db')

const toiletSchema=new mongoose.Schema({
    id:String,
    name:String,
    level:String,
    construction:String,
    opening:String,
    management:String,
    resp:String,
    addr:String,
    sum:Number,
    man:Number,
    woman:Number,
    pool:Number,
    itemStatus:Object,
})

const problemSchema=new mongoose.Schema({
    key:String,
    source:String,
    name:String,
    addr:String,
    content:String,
    user:String,
    type:String,
    time:String,
    status:String,
    operate:String,
    toiletID: String,
})

const opinionSchema=new mongoose.Schema({
    key:String,
    name:String,
    addr:String,
    unit:String,
    opinion:String,
    time:String,
    user:String,
    source:String,
    operate:String,
    toiletID: String,
})

const toiletModel=mongoose.model('toilet',toiletSchema,'toilet')
const problemModel=mongoose.model('problem',problemSchema,'problem')
const opinionModel=mongoose.model('opinion',opinionSchema,'opinion')

module.exports={toiletModel,problemModel,opinionModel}